package com.github.kezhenxu94.playground.java.miscellaneous;

import java.util.ArrayList;
import java.util.List;

public class RuntimeConstantPoolOOM {

	public static void main(final String[] args) {
		final String str1 = new StringBuilder("计算机").append("软件").toString();
		System.out.println(str1.intern() == str1);

		final String str2 = new StringBuilder("ja").append("va").toString();
		System.out.println(str2.intern() == str2);

		final List<String> list = new ArrayList<>();
		for (int ii = 0;; ii++) {
			list.add(String.valueOf(ii).intern());
		}
	}
}
